<div id="articles">
<? echo $adminMenu->manage(); ?>
<h2><? __('ARTICLES_ADMIN_TITLE');?> (<? echo $html->link(__('ARTICLE_NEW',true), array('action'=>'add')); ?>)</h2>
<? echo $form -> create(array('action'=>'delete_articles')); ?>
<table cellpadding="3" cellspacing="1" width="100%">
<tr>
	<td width="10%"></td>
	<td></td>
	<td width="10%"></td>
	<td width="10%"></td>
	<td width="10%"></td>
	<td width="10%"></td>
</tr>
<tr class="table_head">
	<td colspan="3" class="first-top">
		<? echo $pagination -> create(null,'articles'); ?>
	</td>
	<td colspan="3" class="last-top">
		<? __('SORT_BY'); ?>: <? echo $paginator->sort(__('NAME',true),'name');?> <? echo $paginator->sort(__('VISITED',true),'visited'); ?> <? echo $paginator->sort(__('CREATED',true),'created');?>
	</td>
</tr>
<tr>
	<th><? __('ACTION'); ?></th>
	<th><? __('NAME'); ?></th>
	<th><? __('CREATED'); ?></th>
	<th><? __('AUTHOR'); ?></th>
	<th><? __('VISITED'); ?></th>
	<th><? __('DELETE'); ?> <input type="checkbox" onclick="checkAll(this,'ArticleDeleteArticlesForm')"/></th>
</tr>
<?
$i = 0;
foreach ($articles as $article):
	$class = null;
	if ($i++ % 2 == 0) {
		$class = ' class="altrow"';
	}
?>
	<tr<? echo $class;?>>
		<td>
			<? echo $html->link($html->image('edit.png',array('alt'=>__('EDIT', true))),array('action'=>'edit', $article['Article']['id']),array('title'=>__('EDIT',true)),null,false); ?> 
			<? echo $html->link($html->image('eye.png',array('alt'=>__("PREVIEW",true))),"/articles/".$time->format("Y/m/d",$article["Article"]["created"])."/".$article["Article"]["seo_link"],array('title'=>__('PREVIEW',true),"target"=>"new"),null,false); ?>
			<? echo $html->link($html->image('bin.png',array('alt'=>__('DELETE', true))), array('action'=>'delete', $article['Article']['id']),array('title'=>__('DELETE',true)), __('DELETE_ITEM', true).' #' . $article['Article']['title'],false); ?>
		</td>
		<td>
			<? echo $html->link($article['Article']['title'], array('action'=>'edit', $article['Article']['id'])); ?>
		</td>
		<td>
			<? echo $date -> niceShort($article['Article']['created']); ?>
		</td>
		<td>
			<? echo $article['User']['name']; ?>
		</td>
		<td>
			<? echo $article['Article']['visited']; ?>
		</td>
		<td  align="center">
			<input type="checkbox" name="data[ArticlesDelete][]" value="<? echo $article['Article']['id']; ?>"/>
		</td>
	</tr>
<? endforeach; ?>
<tr class="table_head">
	<td colspan="3" class="first-bottom">
		<? echo $pagination -> create(null,'articles'); ?>
	</td>
	<td colspan="3" class="last-bottom">
		<? __('SORT_BY'); ?>: <? echo $paginator->sort(__('NAME',true),'name');?> <? echo $paginator->sort(__('VISITED',true),'visited'); ?> <? echo $paginator->sort(__('CREATED',true),'created');?>
	</td>
</tr>
</table>
<div style="float: right; margin: 1em;"><? echo $form -> submit(__('DELETE',true)); ?></div>
</form>
</div>